<%@page import="java.util.Calendar"%>
<%@page import="com.rw.table.Rule"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=gbk"
    pageEncoding="utf-8"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%> 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html>
  <head>
    <base href="<%=basePath%>">
    <meta http-equiv="Content-Type" content="text/html; charset=gbk">
    <title>会员查询页面-B2C-racewind商城</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	

	<style  type="text/css">
			@import "./css/back/header_back.css";
			@import "./css/back/user_Manage.css";
	</style>
	
	<script language="javascript" type="text/javascript" src="javascript/checkTools.js">
	</script>
	<script language="javascript" type="text/javascript" src="javascript/commonCheck.js">
	</script>
	<script language="javascript" type="text/javascript" src="javascript/Admin/user_manage.js">
	</script>
	

  </head>
  
  <body>
  
     <jsp:include flush="true" page="header_back.jsp"></jsp:include>
          
     <div class="userManagementFrame">
		<div class="allTableFrame">
			<h2>会员管理</h2>
			<div class="levelShow">
				<h3>会员级别设置</h3>
				<%
					@SuppressWarnings("unchecked")
					List<Rule> rules = (List<Rule>)request.getAttribute("rules");
					if(rules == null){
				%>
				<table border="0" align="center">
     				<tr>
     					<td>
     					<a>    </a> 
     					</td>
     				</tr>
     				<tr>
     					<td>
     					<a>没有可显示的数据</a> 
     					</td>
     				</tr>
    		 	</table>
				<%
					}else{
				%>
				<table>
					<tr>
						<td>会员级别</td>
						<td> <pre>&#9;</pre> </td> 
						<td>积分下限</td>
						<td> <pre>&#9;</pre> </td> 
						<td>会员折扣</td>
						<td> <pre>&#9;</pre> </td> 				
					</tr>
				<%
					if(rules == null || rules.size() == 0){
				%>
					<tr>
						<td><a>数据库没有积分关系记录</a></td>
					</tr>
				<%
					}else{
						Iterator<Rule> iterator = rules.iterator();
						while(iterator.hasNext()){
							Rule rule = iterator.next();
						
				%>
					<tr>
						<td><%=rule.getRuleGradeName() %></td>
						<td> <pre>&#9;</pre> </td> 
						<td><%=rule.getRuleScoreLimit() %></td>
						<td> <pre>&#9;</pre> </td> 
						<td><%=rule.getRuleScorePercent() %>%</td>
						<td> <pre>&#9;</pre> </td> 		
					</tr>
				<%
						}
					} 
				%>
				</table>
				<form id="pointSet" method="post" action="modifyRuleAction" name="ruleForm" onsubmit="return checkRuleInput()">
				<table>
					<tr>
						<td>会员级别：</td>
						<td>
						<select name="ruleId">
						<%
							if(rules == null || rules.size() == 0){
								
							}else{
								Iterator<Rule> iterator = rules.iterator();
								while(iterator.hasNext()){
									Rule rule = iterator.next();
						%>
							<option value =<%=rule.getRuleId() %>><%=rule.getRuleGradeName() %></option>
						<%
								}
							} 
						%>
						</select>
						</td>
						<td> <pre>&#9;</pre> </td> 
					</tr>
					<tr>
						<td>积分下限：</td>
						<td><input id="lowerLimit" name="scoreLimit" type="text" style="width:80px;height:18px"/>
						</td>
						<td> <pre>&#9;</pre> </td> 
						<td style="color:red">当会员积分大雨相应等级的积分下限时，会员自动升级</td>
					</tr>
					<tr>
						<td>会员折扣:</td>
						<td><input id="lowerLimit" name="scorePercent" type="text" style="width:40px;height:18px"/>%</td>
						<td> <pre>&#9;</pre> </td> 
						<td style="color:red">会员购买物品时的折扣优惠</td>
					</tr>
					<tr>
					<td> <pre>&#9;</pre> </td> 
					<td colspan="2">
					<input type="submit" value="提交"/>
					<input type="button" value="重填"/>
					</td>
					</tr>		
				</table>
				</form>
			</div>
			<div class="userQuery">
				<h3>会员查询</h3>
				<form id="memberQuery" method="post" name="userSearchForm" onsubmit="return checkUserSearch()">
					<table  cellpadding="10">	
						<tr>
							<td>会员号:</td>
							<td>
							<input id="lowerLimit" name="userEmail" type="text" style="width:80px;height:18px"/>
							</td>
						</tr>
						
						<tr>
							<td>注册起始时间：</td>
							<td>
							   <select id="querystartyear" name="querystartyear">
								  <% 
								  	int currentyear = Calendar.getInstance().get(Calendar.YEAR);		  	
									for(int year = 2010; year <= currentyear;year ++){
									%>
										<option value="<%=year%>"><%=year%></option>
									<% 
									} 
								  %>
								</select><a>年</a>	
								<select id="querystartmonth" name="querystartmonth">
								  <%
									int mon = 1;
									for( mon = 1;mon <= 12;mon++){
									%>
										<option value ="<%=mon%>"><%=mon%></option>
										<% 
									}
								  %>
								</select><a>月</a>
								<input type="text" id="querystartday" name="querystartday" Style="width:30px" maxlength="2" value="1" onblur="checkday('querystartyear','querystartmonth',this);"/>
								<a>日</a>							
							</td>
						</tr>
												<tr>
							<td>注册结束时间：</td>
							
							
							<td>								
								<select id="querystopyear" name="querystopyear">
								  	<% 		  	
									for(int year = 2010; year <= currentyear;year ++){
									%>
									<% if(year == currentyear){%>
										<option value="<%=year%>" selected="selected"><%=year%></option>
									<%
										}else{ 
									%>
										<option value="<%=year%>"><%=year%></option>
									<%
										}
									} 
								  	%>
								</select><a>年</a>	
								<select id="querystopmonth" name="querystopmonth">
								  	<%									
									for( mon = 1;mon <= 12;mon++){
									%>
									<% if(mon == 12){%>
										<option value="<%=mon%>" selected="selected"><%=mon%></option>
									<%
										}else{ 
									%>
										<option value ="<%=mon%>"><%=mon%></option>
									<% 
										}
									}
								  %>
								</select><a>月</a>
								<input type="text" id="querystopday" name="upDay" Style="width:30px" maxlength="2" value="1" onblur="checkday('querystopyear','querystopmonth',this);"/>
								<a>日</a>																			
							</td>
						</tr>
						<tr>
							<td> <pre>&#9;</pre> </td> 
							<td colspan="2">
							<input type="image" src="images/src/button/query.png" onclick="memberQuery.action='getUserAction';"/>
							<input type="image" src="images/src/button/reset.png" onclick="formReset('memberQuery')"/>
							</td>
						</tr>		
					</table>
				</form>
				
			</div>
				<%
					}
				%>
		</div>			  
	 </div>
	   	
      <jsp:include flush="true" page="../B2C/footer.jsp"></jsp:include>
  </body>
</html>
